/*
 * @Author: xinyang3
 * @Date: 2021-09-01 11:38
 * @Descripttion: 路由配置
 * @LastEditors: xinyang3
 * @LastEditTime: 2022-04-02 18:04
 */
import Router from '@koa/router';

const router = new Router();
router.use('/bgmg/', async function (ctx, next) {
  const response = ctx.response;
  response.set('Access-Control-Allow-Origin', '*');
  response.set(
    'Access-Control-Allow-Methods',
    'OPTIONS, GET, PUT, POST, DELETE'
  );
  response.set('Access-Control-Max-Age', -1);
  response.set(
    'Access-Control-Allow-Headers',
    'x-requested-with, accept, origin, content-type'
  );
  // response.set('Content-Type', 'application/json;charset=utf-8');
  // response.set('Access-Control-Allow-Credentials', true);
  await next();
});

export default router;
